<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePatientTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::dropIfExists('patient');
		
		Schema::create('patient', function(Blueprint $table) {
			$table->engine = 'InnoDB';
			
			$table->increments('pat_id');
			$table->string('name', 100);
			$table->string('lastname', 100);
			$table->integer('idty_id'); // fk: identification_type
			$table->string('identification_number', 100);
			$table->string('cou_id'); // fk: country, país de nacimiento
			$table->string('city'); // fk: city
			$table->date('birthday');
			$table->enum('gender', array('m', 'f', 'o'));
			$table->integer('mast_id'); // fk: marital_status, estado civil
			$table->integer('occ_id'); // fk: occupation, ocupación
			$table->string('main_address', 200); // dirección principal

			$table->timestamps();
			$table->softDeletes();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		//
	}

}
